package part2;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class Main {
    public static void main(String[] args) {
        DataInputStream dataInputStream = null;
        try {
            // 这就是一个装饰器的作用。把文件流，装饰为DataInputStream
            dataInputStream = new DataInputStream(new FileInputStream("d:\\1.txt"));
            System.out.println(dataInputStream.read());
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (dataInputStream != null) {
                    dataInputStream.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
